package com.compty.paint.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;


/**
 * @Todo:作品类型(画种二级分类)如人物画、风景画、花鸟画等
 * @author: zhuqh
 * @CreateTime:2011-5-31 下午05:17:55
 */
@Entity
@Table(name = "t_paint_type")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class PaintType implements java.io.Serializable {

	private static final long serialVersionUID = 4802187566701851429L;

	private Long id;

	/************ 类型名称  ****************/
	private String typeName;
	
	/************  一级分类   ****************/
	private CatalogType catalogType;
	

	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="typename",nullable=false,length=40)
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name="catalogtype_id")
	public CatalogType getCatalogType() {
		return catalogType;
	}

	public void setCatalogType(CatalogType catalogType) {
		this.catalogType = catalogType;
	}

}
